<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/jsp/common/common.jsp" %>
<script src="<%=basePath%>/static/js/jquery.ztree.all-3.5.min.js"></script>
<link href="<%=basePath%>/static/css/metroStyle.css" rel="stylesheet" type="text/css">
<%
	String domainId = request.getAttribute("domainId") == null?"":request.getAttribute("domainId").toString();
%>
</head>
<body>

<div class="tableMainWarp">
  <ul id="ztreeUl" class="ztree"></ul>
</div>

<script type="text/javascript">

var zTreeGobalObjcet;

$(document).ready(function(){
	
	var bodyHt=document.documentElement.clientHeight;
	var tableDivHeight = bodyHt-97;	
	//$('#middleCon').height(tableDivHeight);
	
	initzTree();
});

/**
 * 初始化zTree
 */
function initzTree(){
	
	var zTreeUrl = '<%=basePath%>/biz/ou/org/getOrganizationData.do?domainId=<%=domainId%>';
	var setting = {
			check: {
				enable: true
			},
			async:{
				enable:true,
				type:'post',
				url: zTreeUrl
			},
    		view: {
    			dblClickExpand: false,
    			showLine: true,
    			selectedMulti: true,
    			showIcon:true
    		},
    		data: {
    			simpleData: {
    				enable:true,
    				idKey: "id",
    				pIdKey: "parentId",
    				rootPId: "-1"
    			}
    		},
    		check: {
    			enable: true,
    			chkStyle: 'radio',
    			radioType:'all'
    		},

    		callback: {
    			onAsyncSuccess: function(){
    				zTreeGobalObjcet.expandAll(true);
    			}
    		}
    	};
    
	zTreeGobalObjcet = $.fn.zTree.init($('#ztreeUl'), setting, null);
}



function onConfrim(){
	var nodes = zTreeGobalObjcet.getCheckedNodes(true);
	return nodes;
}


</script>
</body>
</html>